n=int(input())
s=0
for a in range(1,n+1):
    a=int(input())
    if a%6==0:
        s+=1
print(s)